package com.example.hellonotes.activity;

import com.example.hellonotes.BaseActivity;
import com.example.hellonotes.R;
import com.example.hellonotes.entity.Person2;
import com.nostra13.universalimageloader.core.ImageLoader;

import android.content.Entity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

public class Select2Activity extends BaseActivity{

	private TextView tv_user,tv_content,tv_time;
	private ImageView iv_image;
	private Person2 entity;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO 自动生成的方法存根
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_select2);
		// 获取intent传入的信息
		entity = (Person2) getIntent().getSerializableExtra("entity");
		initView();
	}
	
	public void initView() {
		tv_user = (TextView)findViewById(R.id.tv_user);
		tv_content = (TextView)findViewById(R.id.tv_content);
		tv_time = (TextView)findViewById(R.id.tv_time);
		iv_image = (ImageView)findViewById(R.id.iv_image);
		
		String content = entity.getContent();
		String path = entity.getPath().getFileUrl(this);
		String time = entity.getCreatedAt();
		String user = entity.getUser().getUsername();
		
		tv_user.setText(user);
		tv_content.setText(content);
		tv_time.setText(time);
		ImageLoader.getInstance().displayImage(path+"", iv_image);
	}
}
